/*
 * crossValidation.c
 *
 *  Created on: Oct 23, 2013
 *      Author: cinus
 */

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

#include "jjann.h"
//#include "activation.h"
#include "topology.h"
#include "training.h"
#include "constants.h"

int main(int argc, char** argv) {

	uint8 status;
	uint32 i, j;
	uint32 folds;
	float32 error;
	float32 input[2], output[1];
	//trainingPattern_t *trainPatterns;
	trainingData_t trainingData;
	netdata_tp net, otherNet;

	//topology_t topo;

	//srand(SEED);

	folds = 10;
	//status = read(&topo, "topology/211.top");

	net = initNetwork("configs/crossvalidation.cfg");
	status = loadSamples(&trainingData, "datasets/iris.training");
	if (status != EXIT_SUCCESS) {
		fprintf(stderr, "Error reading configuration, aborting program\n");
		exit(status);
	}
	error = crossValidation(net, trainingData.samples, trainingData.sampleSize, folds);
	destroyNetwork(net);
	freeSamples(&trainingData);
	fprintf(stderr, "CrossValidation done, error: %f\n", error);
}
